/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package j2ee.impl;

import j2ee.CmrFieldType;
import j2ee.J2eePackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Cmr Field Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link j2ee.impl.CmrFieldTypeImpl#getCmrFieldName <em>Cmr Field Name</em>}</li>
 *   <li>{@link j2ee.impl.CmrFieldTypeImpl#getCmrFieldType <em>Cmr Field Type</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class CmrFieldTypeImpl extends EObjectImpl implements CmrFieldType {
	/**
	 * The default value of the '{@link #getCmrFieldName() <em>Cmr Field Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCmrFieldName()
	 * @generated
	 * @ordered
	 */
	protected static final String CMR_FIELD_NAME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getCmrFieldName() <em>Cmr Field Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCmrFieldName()
	 * @generated
	 * @ordered
	 */
	protected String cmrFieldName = CMR_FIELD_NAME_EDEFAULT;

	/**
	 * The default value of the '{@link #getCmrFieldType() <em>Cmr Field Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCmrFieldType()
	 * @generated
	 * @ordered
	 */
	protected static final String CMR_FIELD_TYPE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getCmrFieldType() <em>Cmr Field Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCmrFieldType()
	 * @generated
	 * @ordered
	 */
	protected String cmrFieldType = CMR_FIELD_TYPE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected CmrFieldTypeImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return J2eePackage.Literals.CMR_FIELD_TYPE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getCmrFieldName() {
		return cmrFieldName;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCmrFieldName(String newCmrFieldName) {
		String oldCmrFieldName = cmrFieldName;
		cmrFieldName = newCmrFieldName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, J2eePackage.CMR_FIELD_TYPE__CMR_FIELD_NAME, oldCmrFieldName, cmrFieldName));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getCmrFieldType() {
		return cmrFieldType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCmrFieldType(String newCmrFieldType) {
		String oldCmrFieldType = cmrFieldType;
		cmrFieldType = newCmrFieldType;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, J2eePackage.CMR_FIELD_TYPE__CMR_FIELD_TYPE, oldCmrFieldType, cmrFieldType));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case J2eePackage.CMR_FIELD_TYPE__CMR_FIELD_NAME:
				return getCmrFieldName();
			case J2eePackage.CMR_FIELD_TYPE__CMR_FIELD_TYPE:
				return getCmrFieldType();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case J2eePackage.CMR_FIELD_TYPE__CMR_FIELD_NAME:
				setCmrFieldName((String)newValue);
				return;
			case J2eePackage.CMR_FIELD_TYPE__CMR_FIELD_TYPE:
				setCmrFieldType((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case J2eePackage.CMR_FIELD_TYPE__CMR_FIELD_NAME:
				setCmrFieldName(CMR_FIELD_NAME_EDEFAULT);
				return;
			case J2eePackage.CMR_FIELD_TYPE__CMR_FIELD_TYPE:
				setCmrFieldType(CMR_FIELD_TYPE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case J2eePackage.CMR_FIELD_TYPE__CMR_FIELD_NAME:
				return CMR_FIELD_NAME_EDEFAULT == null ? cmrFieldName != null : !CMR_FIELD_NAME_EDEFAULT.equals(cmrFieldName);
			case J2eePackage.CMR_FIELD_TYPE__CMR_FIELD_TYPE:
				return CMR_FIELD_TYPE_EDEFAULT == null ? cmrFieldType != null : !CMR_FIELD_TYPE_EDEFAULT.equals(cmrFieldType);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (cmrFieldName: ");
		result.append(cmrFieldName);
		result.append(", cmrFieldType: ");
		result.append(cmrFieldType);
		result.append(')');
		return result.toString();
	}

} //CmrFieldTypeImpl
